# conftest.py
import pytest

from codings.yunsuan import DoYunSuan


def pytest_collection_modifyitems(config, items):
    """
    处理测试项，确保中文字符正确显示
    """
    for item in items:
        # 对测试名称和节点ID进行编码处理
        item.name = item.name.encode('utf-8').decode('unicode_escape')
        item._nodeid = item.nodeid.encode('utf-8').decode('unicode_escape')

@pytest.fixture(scope="class",autouse=True)
# def mySelfJiaju():
#     #前置
#     print("公共模块下自定义类的夹具前")
#     yield 10
#     print("公共模具下自定义的夹具后")

def getMyclass():
    #前置
    print("公共模块下自定义类的夹具前")
    ys = DoYunSuan()
    yield ys
    print("公共模具下自定义的夹具后")